//
//  ViewController.swift
//  TransitionView
//
//  Created by flipped on 2025/1/15.
//

import UIKit

class ViewController: UIViewController {
  @IBOutlet var img2: UIImageView!
  @IBOutlet var img1: UIImageView!

  private var retVisible: Bool = true
  override func viewDidLoad() {
    super.viewDidLoad()

    view.addSubview(img1)
    img1.frame = view.bounds
  }

  override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    super.touchesBegan(touches, with: event)
    //		ios 13不建议
    //		UIView.beginAnimations(nil, context: nil)
    //		UIView.setAnimationTransition(.curlDown, for: img1, cache: true)
    //		UIView.setAnimationDuration(1)
    //		UIView.commitAnimations()

    UIView.animate(withDuration: 1, delay: 0, options: .transitionCurlDown) {
//			self.img1.frame = self.view.bounds
    }
  }
}
